﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="CNTinTuc.aspx.cs" ValidateRequest="false" Inherits="Admin_TinTuc_CNTinTuc" %>

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HomePlaceHolder" runat="Server">
    <script type="text/javascript">
        var GB_ROOT_DIR = "../../GREY_BOX/";
    </script>
    <script language="javascript" type="text/javascript">
        function Upload_HinhAnh() {
            var sFileName = document.getElementById('<%=H_AnhDaiDien.ClientID%>').value;
            var url = "../Admin/TinTuc/UploadImage.aspx?sFileName=" + sFileName;
            return GB_showCenter('Tải ảnh đại diện', url, 220, 500);
        }
        function Insert_Image(imgPath, imgName) {
            document.getElementById('<%=imgViewer.ClientID%>').src = "../" + imgPath;
            document.getElementById('<%=H_AnhDaiDien.ClientID%>').value = imgName;
        } 
    </script>
    <script src="../../GREY_BOX/AJS.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/AJS_fx.js" type="text/javascript"></script>
    <script src="../../GREY_BOX/gb_scripts.js" type="text/javascript"></script>
    <div class="hrm_header_placeholder">
        Tạo mới bài viết</div>
    <div style="float: right; left: 0">
        <table border="0" width="100%" align="left" cellpadding="0" cellspacing="0">
            <tr>
                <td width="100%" height="105" style="padding-left: 25px">
                    <asp:Image ID="imgViewer" ToolTip="Ảnh Đại Diện" runat="server" ImageUrl="~/Images/no_image.jpg"
                        CssClass="imgviewer" onclick="JavaScript:Upload_HinhAnh()" Width="130" Height="105" />
                </td>
            </tr>
            <tr>
                <td style="padding: 5px">
                    &nbsp;&nbsp;(Kích vào hình để tải ảnh đại diện)
                </td>
            </tr>
        </table>
    </div>
    <div style="padding: 10px; float: left">
        <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
        <asp:HiddenField ID="H_AnhDaiDien" Value="" runat="server" />
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="4" height="10">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Tiêu đề tin
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td width="400">
                    <asp:TextBox ID="txtTieuDeTin" CssClass="hrm_textbox" Width="400px" MaxLength="100"
                        runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                        ControlToValidate="txtTieuDeTin" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="5" height="4">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Nhóm Tin Tức
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td width="400">
                    <asp:DropDownList ID="cboTinTuc" CssClass="hrm_combobox" Width="205px" runat="server" AutoPostBack="True" OnTextChanged="cboTinTuc_TextChanged">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" SetFocusOnError="True"
                        InitialValue="0" ControlToValidate="cboTinTuc" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                </td>                
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Nhóm Sub Tin Tức
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td width="400">
                    <asp:DropDownList ID="cboSubTintuc" CssClass="hrm_combobox" Width="205px" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                        InitialValue="0" ControlToValidate="cboSubTintuc" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                </td>                
            </tr>
            <tr>
                <td colspan="5" height="4">
                </td>
            </tr>
            <tr>
                <td colspan="5">
                </td>
            </tr>
            <tr>
                <td colspan="4" height="4">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Tóm tắt
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td width="400">
                    <asp:TextBox ID="txtTomTat" CssClass="hrm_textbox" Width="400px" TextMode="MultiLine"
                        Height="100" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="True"
                        ControlToValidate="txtTomTat" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                </td>
            </tr>
        </table>
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="4" height="4">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Nội dung
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td>
                    <FTB:FreeTextBox ID="txtContent" ImageGalleryPath="~/Upload/TinTuc" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|InsertImageFromGallery,InsertTable,Preview,WordClean"
                        runat="Server" Width="600px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" SetFocusOnError="True"
                        ControlToValidate="txtContent" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="4" height="4">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Trạng Thái
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td>
                    <asp:CheckBox ID="chkTinNong" Checked="true" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="4" height="10">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                    Tác giả
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtTacGia" Enabled="false" CssClass="hrm_textbox" Width="200px"
                        MaxLength="50" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="4" height="10">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="80" class="hrm_title_blue">
                </td>
                <td width="7" class="hrm_title_blue">
                </td>
                <td>
                    <asp:ImageButton ID="cmdLuu" ImageUrl="~/Images/save.jpg" runat="server" OnClick="cmdLuu_Click" />
                    <asp:ImageButton ID="cmdNhapTiep" ImageUrl="~/Images/nhaptiep.jpg" CausesValidation="false"
                        runat="server" OnClick="cmdNhapTiep_Click" />
                    <asp:ImageButton ID="cmdQuayLai" CausesValidation="false" ImageUrl="~/Images/quaylai.jpg"
                        runat="server" PostBackUrl="~/Admin/TinTuc/QLTinTuc.aspx" />
                </td>
            </tr>
            <tr>
                <td colspan="4" height="20">
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
